package com.zx.platform.service;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;

import com.zx.platform.service.domain.MenusDomain;
import com.zx.platform.service.model.MenusModel;

/**
 * Created by IntelliJ IDEA. User: Administrator Date: 14-3-1 Time: 上午11:06 To
 * change this template use File | Settings | File Templates.
 */
public interface MenusService {

	/**
	 * 查找所有数据列表
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List getAllList() throws DataAccessException;

	/**
	 * 根据单Key查找Model
	 * 
	 * @param key
	 * @return
	 * @throws DataAccessException
	 */
	public MenusModel getModelByKey(Integer key) throws DataAccessException;

	/**
	 * 根据Model查找列表
	 * 
	 * @param key
	 * @return
	 * @throws DataAccessException
	 */
	public List getListByModel(MenusModel model) throws DataAccessException;

	/**
	 * 新增并返回主键
	 * 
	 * @param directoryModel
	 * @return
	 * @throws DataAccessException
	 */
	public Integer add(MenusModel model) throws DataAccessException;

	/**
	 * 更新并返回主键
	 * 
	 * @param directoryModel
	 * @throws DataAccessException
	 */
	public Integer update(MenusModel model) throws DataAccessException;

	/**
	 * 删除
	 * 
	 * @param pageSize
	 * @param pageNum
	 * @param directoryModel
	 * @return
	 * @throws DataAccessException
	 */
	public void delete(MenusModel model) throws DataAccessException;

	/**
	 * 分页查询
	 * 
	 * @param pageSize
	 * @param pageNum
	 * @param directoryModel
	 * @return
	 * @throws DataAccessException
	 */
	public Map getPageByDomain(int pageSize, int pageNum,
			MenusDomain domain) throws DataAccessException;

	/**
	 * 根据roleId获得相关联的menuList
	 * @param model
	 * @return
	 * @throws DataAccessException
	 */
	public List getMenusByRoleId(Integer roleId) throws DataAccessException;
}
